<html>

<head>

    <script src="../axton.js"></script>
    <script src="../axton-security.js"></script>
    <script src="../axton-test.js"></script>
    <script>
        axton.security.lockDOMCreateElement();
    
        function lock() {
            var test = new axton.test.TestCase({
                scriptLocal : function() {
                    var elem;
                    //try {
                        elem = axton.dom.$N.call(document.getElementsByTagName("head")[0],"script",{src : "local.js"});
                    //} catch (ex2) {
                    //    alert(ex2.message);
                    //}
                    axton.test.assert.isUndefined(elem);
                    
                }/*,
                scriptDeny : function() {
                    var elem;
                    try {
                        alert("Test Direction: Please click OK at the next prompt");
                        elem = document.createElement("script");
                    } catch (ex1) {}
                    axton.test.assert.isUndefined(elem);
                    if (elem) {
                        axton.dom.$R.apply(elem);
                    }
                },
                baseDeny : function() {
                    var elem;
                    try {
                        alert("Test Direction: Please click OK at the next prompt");
                        elem = document.createElement("base");
                    } catch (ex2) {}
                    axton.test.assert.isUndefined(elem);
                    if (elem) {
                        axton.dom.$R.apply(elem);
                    }
                },
                scriptAllow : function() {
                    var elem;
                    try {
                        alert("Test Direction: Please click CANCEL at the next prompt");
                        elem = document.createElement("script");
                    } catch (ex1) {}
                    axton.test.assert.isUndefined(elem);
                    
                },
                baseAllow : function() {
                    var elem;
                    try {
                        alert("Test Direction: Please click CANCEL at the next prompt");
                        elem = document.createElement("base");
                    } catch (ex2) {}
                    axton.test.assert.isUndefined(elem);
                    
                }*/
            }, {
                /*scriptDeny : true,
                baseDeny : true,
                scriptAllow : false,
                baseAllow : false,*/
                scriptLocal : false
            });
            test.resultsElement = $("results");
            
            test.run();
        }
    </script>
    <link type="text/css" rel="stylesheet" href="../axton-test.css" />
    <style>
        body {
            background-color : #434343;
            padding : 5%;
        }
        h1#a {
            position : absolute;
            top : -15px;
            left : 6px;
        }
        h1#b {
            position : absolute;
            top : -17px;
            left : 4px;
            color : white;
        }
        #results {
            border : 3px double #434343;
            background-color : white;
            width : 40%;
            height : 90%;
            overflow-y : auto;
            position : absolute;
            top : 5%;
            left : 50%;
            padding : 2px;
        }
        .test {
            width : 40%;
            margin-bottom : 5px;
            border : 3px double #434343;
            background-color : white;
            padding : 3px
        }
    </style>

</head>
<body>
<h1 id="a">axton : test cases</h1>
<h1 id="b">axton : test cases</h1>
<div id="results">
Test Results Window <button onclick="while (this.nextSibling) axton.dom.$R.apply(this.nextSibling);">Clear</button>
</div>
<div class="test">
<strong>Browser XSS Lockdown Test</strong>
<button onclick="lock();">Start</button>
<br />This test will verify the proper operation of the lockdown security functions.
</div>
</body>